<template>
  <div class="goodsDesc">
    <h3>{{info.title}}</h3>
    <hr />
    <div class="content" v-html="info.content"></div>
  </div>
</template>
 
<script>
export default {
  name: "",
  data() {
    return {
      id: this.$route.params.id,
      info: {}, //图文介绍数据
    };
  },
  mounted() {
    this.getGoodsDesc();
  },
  methods: {
    getGoodsDesc() {
      this.$http.get("api/goods/getdesc/" + this.id).then((res) => {
        if (res.body.status === 0) {
          //  console.log(res.body.message);
          this.info = res.body.message[0];
        }
      });
    },
  },
};
</script>
 
<style  lang = "scss">
/* 把scoped去掉样式就好了 */
.goodsDesc {
  h3 {
    font-size: 16px;
    color: #226aff;
    text-align: center;
    margin: 15px px;
  }
  .content {
    padding: 0 10px;
    img{
      width: 100%;
    }
  }
}
</style>